import $api from '.';

interface store {
  name: string;
  number: number | string;
  [key: string]: any;
}

// 添加店铺
export const addstore = function (data: store) {
  return $api.post('/storelist', data);
};

// 获取店铺列表
export const getstoreList = function (data: { $limit: number; $skip: number; storename?: any; state?: any; }) {
  console.log('data', data);
  data.$limit = data.$limit || 20;
  data.$skip = data.$skip || 0;
  return $api.get('/storelist', {
    params: data,
  });
};

// 删除店铺
export const delstore = function (id: number) {
  return $api.delete(`/storelist/${id}`);
};

// 修改店铺信息
export const updatestore = function (id: number, data: any) {
  return $api.patch(`/storelist/${id}`, data);
};
// 搜索店铺信息
// export const searchstore = function (data: { $limit: number; $skip: number; storename: any;}) {
//   console.log('data', data);
//   data.$limit = data.$limit || 20;
//   data.$skip = data.$skip || 0;
//   return $api.get('/storelist', {
//     params: data,
//   });
// };

export default {};
